package com.noreply.demo.h2;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author noreply
 * @description
 * @datetime 2021/10/8 14:46
 */
@RestController
@RequestMapping("/h2")
public class LocationController {
    @Autowired
    private LocationRepository locationRepository;

    @GetMapping("/location/add")
    public Object add() {
        LocationDO location = new LocationDO();
        //location.setId(System.currentTimeMillis());
        location.setLatitude(221.221D);
        location.setLongtitude(343.567);
        location.setType("mall");
        locationRepository.save(location);
        return location;
    }
}
